package com.ketti.team;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

import android.content.Context;
import android.util.Log;

public class FileIO {
	private final String tag = "FileIO";
	private Context mContext;
	
	public FileIO(){}
	
	public FileIO(Context context){
		mContext = context;
	}
	
	public String readFile(String path, String fileName){
		String source = null;
				
		try {
			File file = new File(path + fileName);
			FileReader fileReader = new FileReader(file);
			BufferedReader bufferedReader = new BufferedReader(fileReader);
			String line = null;
			while((line = bufferedReader.readLine()) != null){
				if(source == null)
					source = (line + "\n");
				else
					source += (line + "\n");				
			}
			bufferedReader.close();
		} catch (IOException e) {
			Log.i(tag, e.getMessage());
		}
		
		return source;
	}
}
